<script language="javascript" type="text/javascript" src="__PUBLIC__/js/My97DatePicker/WdatePicker.js"></script>
<style>
.list td{ border-right: 1px #d2d2d2 solid; text-align: center;}
</style>
<div>
    <table class="list">
      <tr>
      		<th colspan="10" style="text-align:center;">退款详情单</th>
			</tr>
			<tr>
				<td width="10%">订单编号</td>
				<td colspan="9" style="text-align: left;padding:0px 20px;"><a target="_blank" href="{:U(MODULE_NAME.'/Order/saleDetail',array('id' => $order['id']))}">{$order.withOrderID}</a></td>
			</tr>
      <tr>
        <td>订单金额</td>
        <td colspan="4">{$order.realPrice}</td>
        <td width="10%">退款金额</td>
        <td colspan="4">{$message.price}</td>
      </tr>
      <tr>
        <td>退款提交人</td>
        <td colspan="4">{$message.sendName}</td>
        <td>提单时间</td>
        <td colspan="4">{$message.sendTime}</td>
      </tr>
       <tr>
        <td>退单目的地</td>
        <td colspan="4">{$message.destinationCity}</td>
        <td>退款类型</td>
        <td colspan="4">{$message.typeName}</td>
      </tr>
      <tr>
        <td>申退类型</td>
        <td colspan="9" style="text-align: left;padding:0px 20px;">{$message.className}</td>
      </tr>
		<tr>
        <td>申退原因</td>
        <td colspan="9" style="text-align: left;padding:0px 20px;">{$message.remark}</td>
      </tr>
      <tr>
        <td rowspan="<?php echo count($messageDetail)+2;?>" style="font-weight:bold;">退单状态</td>
      </tr>
      <tr>
        <td width="10%">渠道审核中</td>
        <td colspan="3">退款审核意见</td>
        <td>操作</td>
        <td colspan="3">审单人</td>
        <td colspan="1" width="10%">审核时间</td>
      </tr>
      <foreach name="messageDetail" item="vo">
      <tr>
        <td>{$vo.receiveGroupName}{$vo.roleName}</if></td>
        <td colspan="3">
		<if condition="$vo.canPass eq false">
		{$vo.reason}
		<else />
			<if condition="$vo.mode eq 0">
			<form method='post' name="form_do" action="{:U(MODULE_NAME. '/Message/orderRefundDeal',array('id'=>$message['id'],'detailID'=>$vo['id'],'type'=>'pass'))}">
				<input type="radio" name="status" value="1" checked="checked" />同意 
				<input type="radio" name="status" value="-1" />不同意
				<input type="text" name="reason" placeholder="意见，同意可不填">
				<input type="submit" class="button-blue" id="submit" value="审核">
			</form>
			<elseif condition="$vo.mode eq 1"/>
			<form method='post' enctype ="multipart/form-data" action="{:U(MODULE_NAME. '/Message/orderRefundDeal',array('id'=>$message['id'],'type'=>'refund'))}">
			<table class="list">
			<tr>
	        <td>说明</td>
	        <td colspan="8" style="text-align: left;">
	        	<span style="color: red;">(退款水单允许不提交，<span style="color: blue;">财务付款最好上传水单)</span></span>
	        </td>
	      	</tr>
			<tr>
	        <td>退款凭证</td>
	        <td colspan="8" style="text-align: left;">
	        	<input id="fileupload" type="file" name="upfile">
	        </td>
	        </tr>
			<tr>
	        <td></td>
	        <td colspan="8" style="text-align: left;">
	        	<input type="submit" class="button-blue" value="退款操作">
	        </td>
	      	</tr>
			</table>
			</form>
			</if>
		</if>
        </td>
        <td><span style="color: blue;">{$vo.statusName}</span></td>
        <td colspan="3"><if condition="$vo.status neq 0">{$vo.operatorName}</if></td>
        <td colspan="1"><if condition="$vo.status neq 0">{$vo.operatorTime}</if></td>
      </tr>
      </foreach>
      <if condition="$message.canCancel eq true">
      <form method='post' name="form_do" action="{:U(MODULE_NAME. '/Message/orderRefundDeal',array('id'=>$message['id'],'type'=>'cancel'))}">
	  <tr>
        <td style="font-weight:bold;">退单取消</td>
        <td colspan="9"><input type="submit" class="button-red" value="取消退款"></td>
      </tr>
      </form>
      </if>
	<tr>
       <td style="font-weight:bold;"></td>
       <td colspan="9">
       	<input type="button" onclick="goBack()" class="button-green" value="返回" />
       </td>
     </tr>
	</table>
</div>
<script type="text/javascript">
function cancel()
{
	if(confirm("你是否要取消退款") == true)
	{
	 	window.location.href = "{:U(MODULE_NAME. '/Message/orderRefundDeal',array('id'=>$message['id'],'type'=>'cancel'))}";
	}
}
</script>
